package thread;


class MyThread2 implements Runnable{
    @Override
    public void run() {
        System.out.println("这是实现Runnable接口创建的线程");
    }
}


public class ThreadDemo18 {
    public static void main(String[] args) {
       Runnable runnable=new MyThread2();
       Thread thread=new Thread(runnable);
       thread.start();
       System.out.println("这是主线程");
    }
}
